using System;
using SmartPeople.Framework.SecuritySpace;

namespace SmartPeople.Framework.SecuritySpace
{
    public interface ISecurityPermissions : ISecurityPermissionsProvider
    {
        bool IsGranted(Guid roleID, Guid documentID);

        /// <summary>
        /// Creates the permission.
        /// </summary>
        /// <param name="roleID">The role ID.</param>
        /// <param name="documentID">The document ID.</param>
        /// <param name="accessType"></param>
        /// <returns></returns>
        ISecurityPermission CreatePermission(Guid roleID, Guid documentID, AccessType accessType);
        ISecurityPermission CreatePermission(Guid roleID, Guid documentID, Guid actionId, AccessType accessType);

        //TestCase:IsRevokedOnRoleForDocument()
        ISecurityPermission GrantPermission(Guid roleID, Guid documentID);
        //TestCase:IsRevokedOnRoleForDocumentAndActions
        ISecurityPermission GrantPermission(Guid roleID, Guid documentID, Guid actionID);
        //TestCase:IsRevokedOnRoleForDocumentAndActionsAndState
        ISecurityPermission GrantPermission(Guid roleID, Guid documentID, Guid actionID, Guid stateID);

        //TestCase:DenyPermissionOnRole()
        ISecurityPermission DenyPermission(Guid roleID, Guid documentID);
        //TestCase: DenyPermissionOnRoleWithRoleDocAction
        ISecurityPermission DenyPermission(Guid roleID, Guid documentID, Guid actionID);
        //TestCase:DenyPermissionOnActionWithState()
        ISecurityPermission DenyPermission(Guid roleID, Guid documentID, Guid actionID, Guid stateID);

        //TestCase:IsRevokedOnRoleForDocument()
        void RevokePermission(Guid roleID, Guid documentID);
        //TestCase:IsRevokedOnRoleForDocumentAndActions
        void RevokePermission(Guid roleID, Guid documentID, Guid actionID);
        //TestCase:IsRevokedOnRoleForDocumentAndActionsAndState
        void RevokePermission(Guid roleID, Guid documentID, Guid actionID, Guid stateID);


        SecurityPermissions.AccessState GetAccessState(Guid roleID, Guid documentID, Guid actionID, Guid stateID);
        bool IsGranted(Guid roleID, Guid documentID, Guid actionID, Guid stateID);
    }
}